home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / Superbase4_d2.adf / Ideas / SB_TO_SP.sbp < prev    next >
Text File  |  1992-08-05  |  2KB  |  74 lines

  1. SBP
  2.  ÿ½
  3.  ÿ½ Demonstration of data transfer between Superbase Pro and Superplan.
  4.  ÿ½ Also illustrates use of ARexx for data transfer going out of SBPro.
  5.  ÿ½ Author : Darin Arrick, Precision Technical Support, 02/06/91
  6.  ÿ½ Superplan should be run first, then SBPro.
  7.  ÿ½
  8.  ÿ½ This program will take values from fields in a database and plot a  
  9.  ÿ½ pie graph of them. 
  10.  ÿ½ 
  11. 
  12.  ÿ½ These commands set up the graph title and first command.
  13.  ÿŠ"/zy",",pia>ENT","=b1>ENT","Data from Superbase via Arexx>ENT"
  14.  ÿŠ"=a2>ENT",",pie>ENT"
  15.  
  16.  filename$ÿ"graphthis1"
  17.  ÿ´ÿ™filename$
  18.  fieldname$ÿ"Price"
  19.  recnum%ÿÿA(filename$)
  20.  
  21.  ÿ½ Clear the sheet, set up the graph title
  22.  ÿ›I%ÿ1ÿq6
  23. ÿ¼cmd$
  24. ÿƒ"SpRexx"ÿ–cmd$
  25. ÿ¡ÿ&ÿ0ÿÿ&ÿÿ1ÿpÿwehandle
  26.  ÿ±i%
  27.  
  28.  ÿ½ Move the values from the fields into an array for easier processing
  29.  ÿ×a%(recnum%)
  30.  ÿÉÿ`
  31.  ÿ›x%ÿ1ÿqrecnum%
  32. a%(x%)ÿPrice 
  33. ÿÉÿ±
  34.  ÿ±x%
  35.  
  36.  ÿ½ Replicate the ",pie" command based on the number of records
  37.  cmd$ÿ"/rra2,a3:a"ÿÿH(ÿF(ÿ(recnum%ÿ1)))ÿ">ENT"
  38.  ÿƒ"SpRexx"ÿ–cmd$
  39.  
  40.  ÿ½ Go to cell c2 and get ready to insert data
  41.  ÿƒ"SpRexx"ÿ–"=c2>ENT"
  42.  r%ÿrecnum%
  43.  
  44.  ÿ½ Send the data from the array to SuperPlan
  45.  ÿ›q%ÿ1ÿqrecnum%
  46. r%ÿr%ÿ1
  47. cmd$ÿ"=c"ÿÿH(ÿF(ÿ(q%ÿ1)))ÿ">ENT"
  48. ÿƒ"SpRexx"ÿ–cmd$
  49. ÿƒ"SpRexx"ÿ–ÿH(ÿF(ÿ(a%(q%))))ÿ">ENT"
  50.  ÿ±q%
  51.  
  52.  ÿ½ Plot the pie graph
  53.  ÿƒ"SpRexx"ÿ–"/vs>ENT"
  54.  
  55.  ÿ½ Reset SuperPlan menu to top level
  56.  ÿƒ"SpRexx"ÿ–">ESC"
  57.  
  58.  ÿ½ Shut everything down 
  59.  ÿƒ""ÿ†
  60.  ÿ†ÿ™"graphthis1"
  61.  ÿ’
  62.  
  63.  ÿ½ Error handler
  64. ehandle: 
  65.  ÿ¡ÿ&ÿÿ1ÿp
  66. ÿÂ"Superplan not responding","Please run it first",0,a%
  67. ÿ’
  68.  ÿ’ÿ¡
  69.  e$ÿ"Number"ÿÿ(ÿ&)
  70.  ÿÂ"Superplan returned an error : ",e$,0,a%
  71.  ÿ’
  72.  
  73.  
  74.